<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>{:C('BRAND_NAME')}登录</title>


        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <link type="image/x-icon" rel="bookmark" href="">
        <link type="image/x-icon" rel="shortcut icon" href="">
        <link rel="stylesheet" href="__PUBLIC__css/common.css">
        <link rel="stylesheet" href="__PUBLIC__css/user-new.css">
        <link rel="stylesheet" type="text/css" href="__PUBLIC__css/login.css">
        <style type="text/css">
            html,body {
                height: 100%;
                margin: 0;
                padding: 0;
            }
            #maincontent {
                min-height: 100%;
                height: auto !important;
                height: 100%;
                margin-bottom: -140px;
            }
            #footer,.push {
                height: 140px;
                clear: both;
            }
            #footer{background-color:#1E1B29;padding-top:15px;box-sizing: border-box}
        </style>
    </head>
    <body>
        <div id="maincontent">
            <agenttpl file='share/header_piece' />
            <!--通用栏广告位-->
            <div class="page-content">
            <form method="post" id="form1" name="">
                <div class="login-box">
                    <h1>
                        <span>登录</span>
                    </h1>
                    <ul>
                        <li>
                            <div>
                                <input type="text" id="username" name="username" placeholder="请输入用户名/手机号" maxlength="20" class="error">
                            </div>
                        </li>
                        <li class="psw">
                            <div>
                                <input id="userpass" name="userpass" maxlength="20" placeholder="请输入登录密码" type="password" style="color: #333;" class="error">
                            </div>
                        </li>

                        <li class="yzm">
                            <div>
                                <input type="text" id="checkCode" name="checkCode" placeholder="请输入验证码" class="error">
                            </div>
                            <a href="javascript:;" class="yzm_img">
                                {:sp_verifycode_img('length=4&font_size=16&width=130&height=30&use_noise=1&use_curve=0','style="cursor: pointer;" title="点击获取"')}
                                <!--<img id="register_checkCodeImg" >-->
                            </a>
                            <script>
                                function changeVerify(){
                                document.getElementById('verify_img').src = "{:U('Front/checkcode/index')}" +
                                        "?length=4&font_size=16&width=130&height=30&use_noise=1&use_curve=0&time=" +
                                        Math.random();
                                }
                            </script>
                            <a href="javascript:;" id="changeImg" onclick="changeVerify();">换一张</a>

                        </li>
                        <li class="error-msg"></li>
                    </ul>
                    <div class="login-but">
                        <a href="javascript:;" id="commit" name="commit" onclick="loginUser()">登 录</a>
                    </div>
                    <p class="forgot-password">
                        <a href="{:U('Front/account/forgetPWD')}">忘记密码？</a>
                    </p>
                </div>
            </form>
            <style>
                .push{position:fixed;top:0px;left:0px;width:100%;height:100%;z-index:2000;background-color:rgba(0,0,0,0.5);display:none;}
                .push>div{width:70%;max-width:400px;margin:0 auto;background-color:#fff;height:200px;margin-top:200px;}
                .push>div>h3{padding-top:30px;margin-left:20px;}
                .push>div>p{margin-top:30px;margin-left:30px;}
                .push>div>button{width:90%;height:40px;border-radius:5px;border:none;box-shadow:0px 0px 1px 1px #efefef;cursor:pointer;margin:20px auto;display:block;}
            </style>
            </div>
        </div>
        <div class="push">
            <div>
                <h3>登录成功</h3>
                <p>登录成功，<span>3</span>秒后自动跳转到个人中心..</p>
                <button><a href="{:U('Front/ucenter/index')}">立即跳转</a></button>
            </div>
        </div>
        <div class="footer">
            <p>Copyright @ 2009 - 2015  All Rights Reserved</p>
            <p>{:C('WEB_ICP')}  </p>
            <p>公司名称：{:C('COMPANY_NAME')}  电话：{:C('COMPANY_PHONE')}</p>
            <p>公司地址：{:C('COMPANY_ADDR')}</p>
        </div>

    </body>
    <script src="__PUBLIC__js/jquery-1.7.2.min.js"></script>
    <script src="__PUBLIC__js/checkCode.js"></script>
    <script src="__PUBLIC__js/demo1.js"></script>
    <script>
                                CodeImg($("#register_checkCodeImg"), $("#changeImg"), "__PUBLIC__")
                                        function loginUser(){
                                        var userName = $("#username").val();
                                        var userPass = $("#userpass").val();
                                        var checkCode = $("#checkCode").val();
                                        if ((userName.trim() === "") || (userPass.trim() === "")){
                                        showMsg($(".error-msg"), "用户名或密码不能为空", "red");
                                        return;
                                        }

                                        if (checkCode.trim() === ""){
                                        showMsg($(".error-msg"), "验证码不能为空", "red");
                                        return;
                                        }

                                        sendData("{:U('Front/account/do_login')}",
                                        {"userName":userName, "userPass":userPass, "checkCode":checkCode},
                                                function(data){
                                                if (data.error === '1'){
                                                showMsg($(".error-msg"), data.msg, "red");
                                                changeVerify();
                                                return;
                                                } else if (data.error === '0'){
                                                window.location.href = "{:U('Front/Account/index')}";
    //                        $(".push").css("display","block");
    //                            var count=3;
    //                            var timer=setInterval(function(){
    //                                count--;
    //                                $(".push>div>p>span").html(count);
    //                                if(count<1){
    //                                    window.location.href="{:U('Front/ucenter/index')}";
    //                                }
    //                            },1000);
                                                }
                                                });
                                        }
    </script>

</html>